<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"/>
	<title>demo</title>
	<meta name="keywords" content=""/>
	<meta name="description" content=""/>
	<meta name="viewport" content="width=device-width"/>
	<link rel="shortcut icon" href="img/touchicon.png"/>
	<link rel="stylesheet" href=""/>
	<style type="text/css"></style>
</head>
<body>
	<input id="mobile" type="text">
	<input type="button" value="隐藏号码" onclick="doSomething()">
	<div class="Number"></div>
	<script>
	function doSomething() {
		var num = document.getElementById('mobile').value;
		var numHide = num.substr(3,4);
		var b = num.replace(numHide,'****');
		var NumObj = document.getElementsByClassName('Number');
		NumObj[0].innerHTML = b ;
	}
	</script>
</body>
</html>